package com.huidz.calendar.app;

import android.app.Application;
import android.content.SharedPreferences;

import com.baidu.mobstat.StatService;
import com.huidz.calendar.util.Url;
import com.lljjcoder.style.citylist.utils.CityListLoader;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

import cn.jpush.android.api.JPushInterface;

public class App extends Application {


    public void onCreate() {
        super.onCreate();
        JPushInterface.init(this);
        CityListLoader.getInstance().loadCityData(this);
        getuser();
        StatService.start(this);
        StatService.setAppChannel(this,"yingyongbao", true) ;
        UMConfigure.init(this,"5e941d23978eea0718fb7123"
                ,"umeng",UMConfigure.DEVICE_TYPE_PHONE,"");
        PlatformConfig.setWeixin(Url.wechatkey, Url.wechatsSecret);
    }

    private SharedPreferences mSharedPreferences,mSharedPreferences1;
    private SharedPreferences.Editor mEditor,mEditor1;

    public void getuser() {
        mSharedPreferences = getSharedPreferences("user", MODE_PRIVATE);  //名称和类型
        mEditor = mSharedPreferences.edit();
        Url.USER_NAME = mSharedPreferences.getString("user_name", "");
        Url.USER_TOKEN = mSharedPreferences.getString("user_token", "");
        Url.USER_MOBILE = mSharedPreferences.getString("user_mobile", "");
        Url.USER_HEAD = mSharedPreferences.getString("user_head", "");
        mSharedPreferences1 = getSharedPreferences("login", MODE_PRIVATE);  //名称和类型
        mEditor1 = mSharedPreferences1.edit();
        Url.QIDONGNUM = mSharedPreferences1.getString("islogin", "");
    }
}
